//
//  LYChatSelectAddressCell.m
//  Btpin
//
//  Created by liuyan on 2019/4/28.
//  Copyright © 2019年 Vic. All rights reserved.
//

#import "LYChatSelectAddressCell.h"

@interface LYChatSelectAddressCell()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *detailLabel;
@property (nonatomic, strong) UIImageView *selectImage;

@end

@implementation LYChatSelectAddressCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

#pragma mark - InitSubViews
- (void)initSubView{
    self.selectImage = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH - 33, 16, 18, 18)] ;
    [self.contentView addSubview:self.selectImage];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5,WIDTH - 48, 25)];
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    self.titleLabel.textColor = RGB(34, 34, 34);
    [self.contentView addSubview:self.titleLabel];
    
    self.detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.titleLabel.left, self.titleLabel.bottom , self.titleLabel.width, 20)];
    self.detailLabel.font = [UIFont systemFontOfSize:12];
    self.detailLabel.textColor = RGB(85, 85, 85);
    [self.contentView addSubview:self.detailLabel];
    
    UIView *lineview = [[UIView alloc] initWithFrame:CGRectMake(0, 49,WIDTH, 1)];
    lineview.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:lineview];
}

- (void)setTitle:(NSString *)title detail:(NSString *)detail isSelect:(BOOL)isSelect{
    _titleLabel.text = title;
    _detailLabel.text = detail;
    if (isSelect) {
        self.selectImage.image = [UIImage imageNamed:@"privacysetting_main_s"];
        self.selectImage.hidden = NO;
    }else{
         self.selectImage.hidden = YES;
    }
}

@end
